package com.platform.common.page;

import io.swagger.annotations.ApiModel;

import java.util.List;


@ApiModel(value = "PageUtil", description = "分页组装工具")
public class PageUtil {
	
	
	
	/**
	 * 结果编码
	 */
	private Integer code;
	/**
	 * 返回的信息
	 */
	private String msg;
	/**
	 * 数据总数
	 */
	private Long count;
	/**
	 * 数据集
	 */
	private List<?> data;

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Long getCount() {
		return count;
	}

	public void setCount(Long count) {
		this.count = count;
	}

	public List<?> getData() {
		return data;
	}

	public void setData(List<?> data) {
		this.data = data;
	}
	
	
   public static String  getCurrPage(Integer currPage) {
	   if(currPage==null||currPage==0) {
		   return 1+"";
	   }else {
		   return currPage+"";
	   }
   }
   
   
   public static String  getLimit(Integer limit) {
	   if(limit==null||limit==0) {
		   return 30+"";
	   }else {
		   return limit+"";
	   }
   }
	
	

}
